import Render from "../Render"
export default class GridRender extends Render{
    constructor(prop){

        super(prop)
        this.name = "grid"
     
    }  
    render(){
        let draw = this.canvas.draw;
        let canvas = draw.context.canvas;
        let context = draw.context
        context.save();
        draw.clear();
        // context.scale(this.DataManager.worldScale.scale,this.DataManager.worldScale.scale);
        context.translate( this.DataManager.worldTransForm.x,this.DataManager.worldTransForm.y)
        let currentGrid = this.DataManager.gridSize * this.DataManager.worldScale.scale
        draw.drawGrid(this.DataManager.worldScale.scale,currentGrid>=this.DataManager.gridSize, this.DataManager.worldTransForm); 
        
        context.restore();
    }
}